package model

import "fmt"

type account struct {
	accountNo string;
	balance float32;
	pwd string;
}

func NewAccount(accountNo string, balance float32, pwd string) *account {
	return &account{
		accountNo: accountNo,
		balance: balance,
		pwd: pwd,
	}
}

func (a *account) GetAccount(){
	fmt.Printf("账户信息为：账号%v, 余额%v, 密码%v\n", a.accountNo, a.balance, a.pwd)
}


func (a *account) SetBalance(newBalance float32)  {
	if newBalance > 20 {
		a.balance += newBalance
	}else {
		fmt.Println("存款金额小于20，请重新进行操作！！！")
	}
}

func (a *account) GetBalance(){
	fmt.Printf("账户余额为：%v\n", a.balance)
}